package com.example.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.example.dao.UxJbcardMapper;
import com.example.service.impl.AutoCbsServerImpl;
import com.example.service.impl.AutoJobcArdMAServerImpl;
import com.example.service.impl.Util;

import net.sf.json.JSONObject;

@RestController
@Component
@RequestMapping("AutoJobcardMA")
public class AutoJobcardMAController extends Util {

	@Autowired
	public AutoJobcArdMAServerImpl AutoJobcArdServer;
	@Autowired
	public AutoCbsServerImpl AutoCbsServer;

	@RequestMapping("GenerateJobcard")
	@ResponseBody
	// @Scheduled(cron = "0 0/2 * * * ?")
	public String auto_GenerateJobcard_MA() throws IOException {
		AutoJobcArdServer.auto_GenerateJobcard_MA(); // 自动生成jobcard
		return "Success";
	}

	@RequestMapping("IssuedJobcard")
	@ResponseBody
	// @Scheduled(cron = "0 0/2 * * * ?")
	public String auto_IssuedJobcardMA() throws IOException {
		AutoJobcArdServer.auto_IssuedJobcardMA(); // 自动下发Jobcard 如果备料满足则直接下发
		return "Success";
	}
	

	@RequestMapping("IssuedJobcardPI_Approve2")
	@ResponseBody
	// @Scheduled(cron = "0 0/2 * * * ?")
	public String auto_IssuedJobcardPI_Approve2() throws IOException {
		AutoJobcArdServer.auto_IssuedJobcardPI_Approve2(); // 自动下发Jobcard 如果备料满足则直接下发
		return "Success";
	}
	
	 
}
